﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

using MP.Core.Library;
using MP.LayerHelper.MP_OBS.BLL;

public partial class Member_Tools_Control_LogsByDateGrp : System.Web.UI.UserControl
{
    DateTime fromDate { get { return FDateTime.ConvertDate(Request["fr"]); } }
    DateTime toDate { get { return FDateTime.ConvertDate(Request["to"]); } }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            loadData();
        }
    }

    void loadData()
    {
        DataTable tbl = MbLogPageManager.CreateInstant().GetLogsTotalByModuleChart(fromDate, toDate);
        tbl.DefaultView.Sort = "ModName";
        tbl.DefaultView.RowFilter = "ViewLogs>0";

        Chart1.Series["Default"].Points.DataBindXY(tbl.DefaultView, "ModName", tbl.DefaultView, "ViewLogs");

        //Chart1.DataSource = tbl.DefaultView;

        //// set series members names for the X and Y values 
        //Chart1.Series["Series 1"].XValueMember = "ModName";
        //Chart1.Series["Series 1"].YValueMembers = "ViewLogs";

        //// data bind to the selected data source
        //Chart1.DataBind();
    }
}
